import Taro from '@tarojs/taro'

/**
 * TopBar 胶囊信息
 */
const BoundInfo = Taro.getMenuButtonBoundingClientRect()
const { top, bottom } = BoundInfo

const sysInfo = Taro.getSystemInfoSync()
const {
  statusBarHeight,
  safeArea: { height },
} = sysInfo
// console.log(BoundInfo, sysInfo, '--------------------')

/** TopBar 高度 */
const TopBarHeight = bottom + top - statusBarHeight
/** 内容高度 */
const ContentHeight = height + statusBarHeight

const GetTopBarInfo = () => ({ TopBarHeight, statusBarHeight, ContentHeight })

/**
 * 自定义 TopBar 栏
 */
export default GetTopBarInfo
